package com.mikao.dao;

import com.mikao.entity.UserTree;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface UserTreeDao extends JpaRepository<UserTree, Long>, JpaSpecificationExecutor {

    /**
     * 根据用户ID查找该用户的下的树
     *
     * @param userId 用户ID
     * @return list
     */
    List<UserTree> findAllByUserIdOrderByCreateTimeDesc(Long userId);

}
